1. Field of Invention
This invention relates to image processing. In particular, this invention relates to image processing apparatus and methods that can rotate an image at any angle when orthogonal transform coding or decoding is performed.
2. Description of Related Art
Generally, an image contains an extremely large amount of data. When the image is stored or transmitted, it is often compressed by coding. Image coding methods are classified into two classes, i.e. lossless coding and lossy coding. In particular, the lossy coding often uses a technique in which pixel values are transformed into transform coefficients in a frequency domain. This is called a transform process. A decoded image is reconstructed from the frequency domain transform coefficients. This is called an inverse-transform process. One such lossy coding method is a discrete cosine transform, which is used in the well known JPEG (Joint Photographic Experts Group) standards.
There will now be explained a coding or decoding process using a frequency domain transform performed along with an image rotation process. The image rotation process is applied to pixel values in a spatial domain. A spatial domain can be, for example, the X-Y coordinate system. In a coding process, an image should be rotated before performing the frequency domain transform. In a decoding process, an image should be rotated after it is frequency domain inverse-transformed into a spatial domain. Thus, a memory is required to store temporarily the rotated image in the coding process or the inverse-transformed image before rotation in the decoding process. In addition, the total processing time of the coding or decoding process increases.
There is a process that performs a rotation process in a frequency domain without transforming an image into a spatial domain. A conventional rotation process in a frequency domain is disclosed by Japanese Laid-Open Patent Application No. 8-204957.
FIG. 15 is a block diagram illustrating the above-referenced conventional image processing apparatus performing a rotation process. The apparatus includes image input unit 42, transform unit 52, transform coefficient processor 90, entropy encoder 61 and image output unit 71. The reference numerals 141, 151, 159 and 160 represent an input image, transform coefficients, transform coefficients after image processing, and code data, respectively.
Image input unit 42 receives an input image from an outside source and outputs the input image 141 (as a plurality of blocks) to transform unit 52. Transform unit 52 performs a frequency domain transform of each block in the input image, and outputs transform coefficients 151 to transform coefficient processor 90. Transform coefficient processor 90 performs image processing of the received transform coefficients and outputs transform coefficients 159 after the image processing to entropy encoder 61. Entropy encoder 61 performs entropy coding of the transform coefficients 159 after the image processing, and outputs code data 160 to image output unit 71. Image output unit 71 outputs the code data of an image to a recording medium (memory), or the like. According to this configuration, the process of the conventional apparatus is explained with reference to FIGS. 16A through 18.
FIG. 16A shows a conventional process that rotates an input image by an angle of 90.degree.. FIG. 16B is a flowchart illustrating the steps performed by the conventional process shown in FIG. 16A. In this example, (a block of) transform coefficients 151 are rotated at an angle of 90.degree. so as to obtain (a block of) transform coefficients 159. In step S200 of FIG. 16B, transform coefficients 152 in each block are calculated from transform coefficients 151 by replacing a transform coefficient of coordinate (u, v) in 151 with that of coordinate (v, u) (see FIG. 17A ). This is referred to as rotation about the u-v axis. In step S210, transform coefficients 159 are calculated by inverting the signs of the transform coefficients 152 located at the odd coordinates u in the block of the transform bases (see FIG. 17B in which the darkened blocks identify the transform coefficient 152 at the odd coordinates). In step S220, each block of (X, Y) is moved to the position (N+1-X, Y) (see FIG. 17C). (X, Y) indicates a position of a block in an image. N indicates the number of blocks in the X direction. Thus, if an image is segmented into a 12.times.12 matrix of blocks, there are 144 blocks, and N=12. Thus, for example, the block at position (1,1) will be shifted to position (12+1-1,1)=(12,1). As a result of this process, an image is rotated at an angle of 90.degree.. In addition, as shown in FIG. 18, an image can be rotated at an angle of 180.degree. or 270.degree. by performing different combinations of processes similar to the processes described above. (With respect to correlating FIG. 18 to FIG. 15, numerals 153 and 154 are transform coefficients like numeral 151; and numerals 157 and 158 are transform coefficients like numeral 159.) As shown in FIG. 18, to rotate by 180.degree., perform a top-bottom symmetrical reversing process followed by a left-right symmetrical reversing process; to rotate by 270.degree., perform a rotation followed by a top-bottom symmetrical reversing process.
As described above, the conventional process can rotate an image at an angle of 90.degree., 180.degree. or 270.degree. by performing image processing in the frequency domain. Thus, the rotation process can be performed in a frequency domain. However, this method cannot rotate an image at any angle other than 90.degree., 180.degree. or 270.degree..